import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class HUDElement here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
  */
public class HUDElement extends Actor
{
    /**
     * Act - do whatever the HUDElement wants to do. This method is called whenever
     * the 'Act' or 'Run' button gets pressed in the environment.
     */
    protected final int fixedX;
    protected final int fixedY;
    private final String name;
    
    public HUDElement(int X, int Y, String name1){
    
        fixedX = X;
        fixedY = Y;
        name = name1;
    }
    
    public void act(){
    if(getX() != fixedX){
      setLocation(fixedX, getY());
    }
    if(getY() != fixedY){
      setLocation(getX(), fixedX);
    }
    
    }
}
